package com.example.jpa;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public final class JpaUtil {
	private static EntityManagerFactory entityManagerFactory = null;

	private JpaUtil() {

	}

	public synchronized static EntityManagerFactory getEntityManagerFactory() {
		if (entityManagerFactory == null) {
			entityManagerFactory = Persistence.createEntityManagerFactory("addressbook");
		}
		return entityManagerFactory;
	}
}
